import React, {PropsWithChildren} from 'react'
import {View} from "@tarojs/components";
import "./List.sass"

export interface ListProps extends PropsWithChildren {
  children?:React.ReactNode[]
}

const List: React.FC<ListProps> = (props) => {
  let children = props.children??[];
  return <>
    <View className={"list-container"}>
      {children.map((e,index)=>{
        return <>
          {index!==0 && <View className={"divider"}></View>}
          {e}
        </>
      })}
    </View>
  </>
}

export default List


